$(function(){

    var hrefUrl = window.location.pathname.toString().substring(1)
    
    var headList = [
        {
            type : 1,
            name : '订单列表',
            href : 'index.html',
            icon : 'fa-list-ul'
        },
        {
            type : 2,
            name : '名师风采',
            href : 'teacher.html',
            icon : 'fa-graduation-cap'
        },
        {
            type : 3,
            name : '培训动态',
            href : 'news.html',
            icon : 'fa-hacker-news'
        },
        {
            type : 4,
            name : 'banner管理',
            href : 'banner.html',
            icon : 'fa-th-large'
        },
        {
            type : 5,
            name : '教学分类',
            href : 'classnav.html',
            icon : 'fa-align-justify'
        },
        {
            type : 6,
            name : '行测分类',
            href : 'classnav_line.html',
            icon : 'fa-align-justify'
        },
        {
            type : 7,
            name : '运营帐号管理',
            href : 'operate.html',
            icon : 'fa-pencil'
        },
        {
            type : 8,
            name : '学生帐号管理',
            href : 'student.html',
            icon : 'fa-pencil'
        },
        {
            type : 9,
            name : '商品管理',
            href : 'common.html',
            icon : 'fa-list-ol'
        },
        {
            type : 10,
            name : '友情链接',
            href : 'friendship.html',
            icon : 'fa-exchange'
        },
        {
            type : 11,
            name : '用户异常列表',
            href : 'userlist.html',
            icon : 'fa-exchange'
        }
    ]
    var headTpl = ''
    headTpl +='<div class="navbar navbar-inverse navbar-fixed-top" style="background-color: #409eff;"  id="navigation">'
    headTpl +='    <div class="navbar-header">'
    headTpl +='        <a class="navbar-brand" href="index.html" style="color:#f1eded">欢迎回来</a>'
    headTpl +='    </div>'
    headTpl +='     <ul class="nav navbar-right top-nav">'
    headTpl +='    <li class="dropdown">'
    headTpl +='        <a href="#" class="dropdown-toggle" style="background-color: #409eff;"><i class="fa fa-user"></i>&nbsp;&nbsp;<span class="user_txt"></span>&nbsp;&nbsp;<span class="login_txt">登录<span> </a>    '
    headTpl +='    </li>'
    headTpl +='     </ul>'
    headTpl +='    <div class="collapse navbar-collapse navbar-ex1-collapse" id="header">'
    headTpl += '<ul class="nav navbar-nav side-nav">'
    for(var i=0;i<headList.length;i++){
        if(hrefUrl == headList[i].href){
            headTpl += '    <li class="active" data-type="'+ headList[i].type +'">'
            
        }else{
            headTpl += '    <li class="" data-type="'+ headList[i].type +'">'
        }
        headTpl += '        <a href="'+ headList[i].href +'"><i class="fa '+ headList[i].icon +'" aria-hidden="true"></i>&nbsp;&nbsp;'+ headList[i].name +'</a>'
        headTpl += '    </li>'
    }
    headTpl += '</ul>'
    headTpl +='    </div>'
    headTpl +='</div>'
    

    $('#page-wrapper').before(headTpl)
})